<?php
class service_weibo{
	const APPKEY = '1979660915';
	const APPSECRET = '22b15a0730dac341e3cf124d7bc8338f';
	
	static public function getAuthorizeUrl($callbackUrl){
		$api = new  SaeTOAuthV2(self::APPKEY,self::APPSECRET);
		$url = $api->getAuthorizeURL($callbackUrl);
		return $url;
	}
	static public function getAccessToken($code,$params){
		$api = new  SaeTOAuthV2(self::APPKEY,self::APPSECRET);
		$token = $api->getAccessToken($code,$params);
		return $token;
	}
	static public function getUserInfo($token,$uid){
		$api = new SaeTClientV2(self::APPKEY,self::APPSECRET,$token);
		$user = $api->show_user_by_id($uid);
		return $user;
	}
}
?>
